package com.zjx.demo.resource;

import org.springframework.core.io.FileSystemResource;

import java.io.*;

/**
 * @author zjx
 * @create 2020-03-30 16:33
 */
public class ResourceDemo {
	public static void main(String[] args) throws IOException {
		FileSystemResource fileSystemResource=new FileSystemResource("D:\\spring-framework\\spring-framework-5.2.0.RELEASE\\springdemo\\src\\main\\java\\com\\zjx\\demo\\resource\\test.txt");
		File file = fileSystemResource.getFile();
		System.out.println(file.length());
		OutputStream outputStream = fileSystemResource.getOutputStream();
		BufferedWriter bufferedWriter =new BufferedWriter(new OutputStreamWriter(outputStream));
	bufferedWriter.write("Hello zjx");
	bufferedWriter.flush();
	outputStream.close();
	bufferedWriter.close();
	}
}
